package com.xiangge.abstract1;

abstract class Normal{
    private String name;
    private int health;
    private int love;
    public abstract void introduction();

    public Normal() {
    }
    public Normal(String name, int health, int love) {
        this.name = name;
        this.health = health;
        this.love = love;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getHealth() {
        return health;
    }

    public void setHealth(int health) {
        this.health = health;
    }

    public int getLove() {
        return love;
    }

    public void setLove(int love) {
        this.love = love;
    }
}

class Pet1 extends Normal{
    @Override
    public void introduction() {
        System.out.println("我是一只雪纳瑞犬");
    }
    public void show(){
    System.out.println("我的名字叫" + getName() + "，我的健康值：" + getHealth() +"，我和主人的亲密度：" + getLove());
}
static class Pet2 extends Pet1{
    @Override
    public void introduction() {
        System.out.println("我的性别是Q妹");
    }
    public void show(){
        System.out.println("我的名字叫" + getName() + "，我的健康值：" + getHealth() +"，我和主人的亲密度：" + getLove());
    }
}
    public static class AbstractTest44 {
        public static void main(String[] args) {
            Pet1 p1 = new Pet1();
            p1.setName("欧欧");
            p1.setHealth(100);
            p1.setLove(0);
            p1.show();
            p1.introduction();
            Pet2 p = new Pet2();
            p.setName("楠楠");
            p.setHealth(100);
            p.setLove(0);
            p.show();
            p.introduction();
        }
    }
}
